package cn.steven.easymedia

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import cn.steven.player.control.EasyPlayer

class MainActivity : AppCompatActivity() {
    private lateinit var player: EasyPlayer
    private var hlsUrl = "http://live.ximalaya.com/radio-first-page-app/live/74/64.m3u8"
    private var hlsUrl2 = "https://video.xintujing.cn/3f3dbb21vodtransgzp1251091601/a6606ed85285890798451409537/v.f230.m3u8"
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        player = EasyPlayer(applicationContext)
        player.setDataSource(hlsUrl, null)
    }

    fun clickPlayOrPause(view: View) {
//        player.playByUrl(hlsUrl)
        player.prepare()
    }
}